#pragma once
#include "afxcmn.h"
#include "afxdtctl.h"


// CDlgHistoryList dialog

class CDlgHistoryList : public CDialog
{
	DECLARE_DYNAMIC(CDlgHistoryList)

public:
	CDlgHistoryList(CWnd* pParent = NULL);   // standard constructor
	virtual ~CDlgHistoryList();

	virtual BOOL OnInitDialog();
	afx_msg void OnBnClickedButtonAll();
	afx_msg void OnBnClickedButtonFind();
	afx_msg void OnEnChangeEditFind();
	afx_msg void OnNMRClickListHistory(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnHdnItemclickListHistory(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnNMDblclkListHistory(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnLvnItemchangingListHistory(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnDtnDatetimechangeDatetimepickerFirst(NMHDR *pNMHDR, LRESULT *pResult);

// Dialog Data
	enum { IDD = IDD_DIALOG_HISTORY_LIST };
	enum HISTORY_TYPE { HISTORY_REQUEST, HISTORY_EXTERNAL_ILL, HISTORY_RECENT };


protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

	DECLARE_MESSAGE_MAP()

private:
	void FillList();
	INT SetDefaultButton(const DWORD nNewId);

public:
	INT m_nType;
	LONG m_nID;
	LONG m_nStaffID;

	CListCtrl m_ctrlHistory;
	CStringArray *m_pszaStatus;
	CArray <STAFF_LOOKUP> *m_paStaffInfo;

	CString m_szFilter;
	CString m_szSort;
	BOOL m_bSortAscending;
	INT m_nCurrentSort;
	LONG m_nCurrentRecord;
	CString m_szFind;
	CDateTimeCtrl m_ctlDateFirst;
};
